from typing import List
from pydantic import BaseModel


class CityTimezone(BaseModel):
    city: str = 'Ижевск'
    timezone: int = 4


class CityTimezonesResponse(BaseModel):
    ru_timezones_list: List[CityTimezone] = [
        CityTimezone(city='Время в UTC', timezone=-11),
        CityTimezone(city='Гонолулу', timezone=-10),
        CityTimezone(city='Анкара', timezone=-9),
        CityTimezone(city='Ванкувер', timezone=-8),
        CityTimezone(city='Денвер', timezone=-7),
        CityTimezone(city='Чикаго', timezone=-6),
        CityTimezone(city='Майами', timezone=-5),
        CityTimezone(city='Сантьяго', timezone=-4),
        CityTimezone(city='Мехико', timezone=-3),
        CityTimezone(city='Время в UTC', timezone=-2),
        CityTimezone(city='Азоры', timezone=-1),
        CityTimezone(city='Лондон', timezone=0),
        CityTimezone(city='Париж', timezone=1),
        CityTimezone(city='Калининград', timezone=2),
        CityTimezone(city='Москва', timezone=3),
        CityTimezone(city='Ижевск', timezone=4),
        CityTimezone(city='Екатеринбург', timezone=5),
        CityTimezone(city='Омск', timezone=6),
        CityTimezone(city='Красноярск', timezone=7),
        CityTimezone(city='Иркутск', timezone=8),
        CityTimezone(city='Якутск', timezone=9),
        CityTimezone(city='Владивосток', timezone=10),
        CityTimezone(city='Магадан', timezone=11),
        CityTimezone(city='Камчатка', timezone=12)
    ]
    en_timezones_list: List[CityTimezone] = [
        CityTimezone(city='Time in UTC', timezone=-11),
        CityTimezone(city='Cook Islands', timezone=-10),
        CityTimezone(city='Alaska', timezone=-9),
        CityTimezone(city='Nevada', timezone=-8),
        CityTimezone(city='Idaho', timezone=-7),
        CityTimezone(city='Texas', timezone=-6),
        CityTimezone(city='Florida', timezone=-5),
        CityTimezone(city='Labrador', timezone=-4),
        CityTimezone(city='Greenland', timezone=-3),
        CityTimezone(city='Time in UTC', timezone=-2),
        CityTimezone(city='Azores', timezone=-1),
        CityTimezone(city='Portugal', timezone=0),
        CityTimezone(city='Spain', timezone=1),
        CityTimezone(city='Egypt', timezone=2),
        CityTimezone(city='Moscow', timezone=3),
        CityTimezone(city='Izhevsk', timezone=4),
        CityTimezone(city='Yekaterinburg', timezone=5),
        CityTimezone(city='Omsk', timezone=6),
        CityTimezone(city='Krasnoyarsk', timezone=7),
        CityTimezone(city='Irkutsk', timezone=8),
        CityTimezone(city='Sakha', timezone=9),
        CityTimezone(city='Khabarovsk', timezone=10),
        CityTimezone(city='Magadan', timezone=11),
        CityTimezone(city='Kamchatka', timezone=12)
    ]

ru_timezones = [
    {
        "city": "Время в UTC",
        "timezone": -11
    },
    {
        "city": "Гонолулу",
        "timezone": -10
    },
    {
        "city": "Анкара",
        "timezone": -9
    },
    {
        "city": "Ванкувер",
        "timezone": -8
    },
    {
        "city": "Денвер",
        "timezone": -7
    },
    {
        "city": "Чикаго",
        "timezone": -6
    },
    {
        "city": "Майами",
        "timezone": -5
    },
    {
        "city": "Сантьяго",
        "timezone": -4
    },
    {
        "city": "Мехико",
        "timezone": -3
    },
    {
        "city": "Время в UTC",
        "timezone": -2
    },
    {
        "city": "Азоры",
        "timezone": -1
    },
    {
        "city": "Лондон",
        "timezone": 0
    },
    {
        "city": "Париж",
        "timezone": 1
    },
    {
        "city": "Калининград",
        "timezone": 2
    },
    {
        "city": "Москва",
        "timezone": 3
    },
    {
        "city": "Ижевск",
        "timezone": 4
    },
    {
        "city": "Екатеринбург",
        "timezone": 5
    },
    {
        "city": "Омск",
        "timezone": 6
    },
    {
        "city": "Красноярск",
        "timezone": 7
    },
    {
        "city": "Иркутск",
        "timezone": 8
    },
    {
        "city": "Якутск",
        "timezone": 9
    },
    {
        "city": "Владивосток",
        "timezone": 10
    },
    {
        "city": "Магадан",
        "timezone": 11
    },
    {
        "city": "Камчатка",
        "timezone": 12
    }
]

en_timezones = [
    {
        "city": "Time in UTC",
        "timezone": -11
    },
    {
        "city": "Cook Islands",
        "timezone": -10
    },
    {
        "city": "Alaska",
        "timezone": -9
    },
    {
        "city": "Nevada",
        "timezone": -8
    },
    {
        "city": "Idaho",
        "timezone": -7
    },
    {
        "city": "Texas",
        "timezone": -6
    },
    {
        "city": "Florida",
        "timezone": -5
    },
    {
        "city": "Labrador",
        "timezone": -4
    },
    {
        "city": "Greenland",
        "timezone": -3
    },
    {
        "city": "Time in UTC",
        "timezone": -2
    },
    {
        "city": "Azores",
        "timezone": -1
    },
    {
        "city": "Portugal",
        "timezone": 0
    },
    {
        "city": "Spain",
        "timezone": 1
    },
    {
        "city": "Egypt",
        "timezone": 2
    },
    {
        "city": "Moscow",
        "timezone": 3
    },
    {
        "city": "Izhevsk",
        "timezone": 4
    },
    {
        "city": "Yekaterinburg",
        "timezone": 5
    },
    {
        "city": "Omsk",
        "timezone": 6
    },
    {
        "city": "Krasnoyarsk",
        "timezone": 7
    },
    {
        "city": "Irkutsk",
        "timezone": 8
    },
    {
        "city": "Sakha",
        "timezone": 9
    },
    {
        "city": "Khabarovsk",
        "timezone": 10
    },
    {
        "city": "Magadan",
        "timezone": 11
    },
    {
        "city": "Kamchatka",
        "timezone": 12
    }
]


def get_city_by_timezone(timezone, language):

    if language == 'ru':
        timezones = ru_timezones
    else:
        timezones = en_timezones

    for timezone_object in timezones:
        if timezone_object.get('timezone') == timezone:
            city = timezone_object.get('city')
            return city
